<template>
  <div>
    <div style="float: right;width: 375px;height: 40px;text-align: right;font-family: 华文琥珀">帮助</div>
    <div class="huanying">欢迎登录美团</div>
    <div class="login">
      <van-form @submit="onSubmit">
        <van-field
          v-model="user.phone"
          name="phone"
          label="手机号"
          placeholder="请输入手机号"
          :rules="[{ required: true, message: '' }]"
          style="margin-left: 12px"/>
        <hr>
        <span>未注册的手机号验证后自动创建美团账户</span>
        <div style="margin: 16px;">
          <van-button round block type="info" native-type="submit" style="color: black;font-weight: bold">获取短信验证码</van-button>
        </div>
      </van-form>
      <router-link to="/"><div style="text-align: left;width: 100px;float: left" @click="">密码登录</div></router-link>
      <div style="float: right">遇到问题</div>
    </div>

  </div>

</template>

<script>
  import axios from 'axios'
    export default {
        name: "login1",
      data(){
        return {
          user:{
            phone:'',
          }
        };
      },
      methods: {
        onSubmit(values) {
          console.log('submit', values);
          sessionStorage.setItem("phone",this.user.phone);
          axios.post("api/user/sendphone",{phone:this.user.phone}).then(res=>{

          })
          this.$router.push("/verify")
        },
      },
    }
</script>

<style scoped>
  .huanying{
    font-weight: bold;
    font-size: 30px;
    margin-left: 10px;
    padding: 0;
    text-align: left;
  }
</style>
